#include <iostream>
using std::cout;
using std::endl;

class Base {
public:
	Base(long base)
    : _base(base)
    { cout << "Base()" << endl; }

    ~Base(){ cout << "~Base()" << endl; }
private:
	long _base = 10;
};


class Test{
public:
    Test(long test)
    : _test(test)
    { cout << "Test()" << endl; }
    ~Test(){ cout << "~Test()" << endl; }
private:
    long _test;
};


class Derived
: public Base 
{
public:
	Derived(long base,long derived,long test,long sonbase)
    : Base(base)//显式调用基类的构造函数
    , _derived(derived)
    , _test(test)//显式调用对象成员的构造函数
    , _sonbase(sonbase)
	{ cout << "Derived(long)" << endl; }

    ~Derived(){ cout << "~Derived()" << endl; }
    
	long _derived;
    Test _test;
    Base _sonbase;//基类的对象成员
};

void test0(){
	Derived d(1,2,3,4);
    /* cout << d._base << endl; */
    cout << sizeof(Base) << endl;
    cout << sizeof(Derived) << endl;

}

int main(void){
    test0();
    return 0;
}
